Skip to content

Migrate indexing::LFS to task system, rather than ringbuffer - #7955

Merged
Amaury Chamayou (achamayou) merged 15 commits into
microsoft:mainfrom
eddyashton:lfs_tasks
Sep 15, 2026
Merged

Amaury Chamayou (achamayou) merged 15 commits into
microsoft:mainfrom
eddyashton:lfs_tasks

Conversation

@eddyashton

Copy link
Copy Markdown
Member

I could have sworn I opened this yesterday? But apparently not.

Copilot AI review requested due to automatic review settings June 18, 2026 15:59
@eddyashton
Eddy Ashton (eddyashton) requested a review from a team as a code owner June 18, 2026 15:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the indexing LFS (large-file cache) path away from ringbuffer-based host messaging and onto the task system, so LFS store/fetch operations are scheduled as ordered tasks rather than sent to a host-side handler.

Changes:

  • Replace ringbuffer messaging for LFS with an OrderedTasks queue backed by a JobBoard, and perform disk I/O from EnclaveLFSAccess.
  • Update indexing tests to drive LFS I/O by draining a JobBoard (synchronously in lfs.cpp, via a flusher thread in indexing.cpp).
  • Remove the obsolete ringbuffer message types and host-side LFSFileHandler plumbing.

Custom instructions used:

  • .github/copilot-instructions.md
  • .github/instructions/reviewing.instructions.md

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/indexing/test/lfs.cpp Switches LFS test plumbing from ringbuffers to draining a JobBoard.
src/indexing/test/indexing.cpp Replaces ringbuffer flushing thread with a JobBoard task-draining thread for LFS.
src/indexing/lfs_ringbuffer_types.h Removes LFS ringbuffer message definitions (no longer used).
src/indexing/enclave_lfs_access.h Implements LFS store/fetch via ordered tasks and direct file I/O under .index.
src/host/run.cpp Removes registration of the host-side LFS ringbuffer message handler.
src/host/lfs_file_handler.h Removes the host-side LFS file handler implementation.
src/enclave/enclave.h Instantiates EnclaveLFSAccess on the main job board and removes ringbuffer handler registration.

Comment thread src/indexing/enclave_lfs_access.h Outdated
Comment thread src/indexing/test/indexing.cpp Outdated
Harden task-based LFS reads against stream failures and clarify LFS access names in tests.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use a compact enum representation and explicit aggregate initializers for blob read outcomes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Host-controlled cache files can trigger unbounded allocation or abort the node through malformed encrypted data.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread src/indexing/enclave_lfs_access.h Outdated
Comment thread src/indexing/enclave_lfs_access.h
The contents of the .index directory are untrusted. A file truncated
below the size of a GCM header made GcmCipher::deserialise throw out
of the fetch action, and a file larger than physical memory was read
into a vector before decryption. Both escaped try_do_task and aborted
the node, instead of being reported as Corrupt so the strategy can
re-index.

Catch the deserialisation failure in verify_and_decrypt, and bound the
admitted file size by the largest blob this instance has stored, which
is published before the write is queued. Only this instance can produce
a decryptable file, so any larger file is invalid without reading it.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep the task-based LFS implementation while adopting the shared time-bound logger location from main.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@achamayou
Amaury Chamayou (achamayou) merged commit ad11ce1 into microsoft:main Sep 15, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants